<?php

// $Id$


class TCMS_VPT_System_Attribute extends Tangra_Class {
	private $id;
	private $template;
	private $sa_name;
	private $sa_export_name;
	private $default_value;
	private $required;
	private $export;

	public function set_id($id) {
		tangra_if_not_int_throw_e($id);

		$this->id = $id;
	}


	public function get_id() {
		return $this->id;
	}


	public function set_template($template) {
		tangra_if_not_int_throw_e($template);

		$this->template = $template;
	}


	public function get_template() {
		return $this->template;
	}

	public function set_sa_name($sa_name) {
		$this->sa_name = $sa_name;
	}


	public function get_sa_name() {
		return $this->sa_name;
	}


	public function set_required($required) {
		$this->required = $required ? true : false;
	}


	public function get_required() {
		return $this->required;
	}


	public function set_sa_export_name($sa_export_name) {
		if ($sa_export_name) {
			if (ereg("[a-z0-9_]{1,255}", $sa_export_name)) {
				$this->sa_export_name = $sa_export_name;
			} else {
				throw new Tangra_Module_Exception('Invalid sa_export_name: '.$sa_export_name.'. Must conform ereg("[a-z0-9_]{1,255}").');
			}
		} else {
			$this->sa_export_name = $sa_export_name;
		}
	}


	public function get_sa_export_name() {
		return $this->sa_export_name;
	}


	public function set_default_value($default_value) {
		$this->default_value = $default_value;
	}


	public function get_default_value() {
		return $this->default_value;
	}


	public function set_export($export) {
		$this->export = $export ? true : false;
	}


	public function get_export() {
		return $this->export;
	}
}